package com.controller.user;

import com.entity.Notice;
import com.service.user.NoticeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
public class NoticeController {
  @Autowired NoticeService noticeService;

  @GetMapping("notice/getNotices")
  public List<Notice> getNotices(
      @RequestParam("userId") String userId, Integer status, Integer pageSize, Integer pageIndex) {
    return noticeService.getAllNotices(userId, status, pageSize, pageIndex);
  }
}
